<template>
  <span>
    <span v-for="operation in operations" :key="operation.$index">
      <slot :name="getSlotName(operation)" :operation="operation">
        <!-- 后备内容 -->
      </slot>
    </span>
  </span>
</template>

<script>
export default {
  name: 'OperationItem',
  // eslint-disable-next-line vue/require-prop-types
  props: ['operations'],
  data() {
    return {}
  },
  methods: {
    getSlotName(operation) {
      // filter 需要显示不同的样式
      return operation.field ? operation.action + '-' + operation.inputType : operation.action
    }
  }
}
</script>

<style scoped>

</style>
